﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace HYElectricSystemDiagram.DataStruct
{
	public class ElectricBoxData
	{
		public ElectricBoxData(string strClsName, Element box, List<HouseBoxLoopData> lstLoop)
		{
			this.m_strClassName = strClsName;
			this.m_eleBox = box;
			this.m_lstLoop.AddRange(lstLoop);
		}

		public bool IsEquals(ElectricBoxData boxData)
		{
			bool result = true;
			if (this.m_lstLoop.Count != boxData.Loops.Count || !this.m_strClassName.Equals(boxData.ClassName))
			{
				return false;
			}
			foreach (HouseBoxLoopData houseBoxLoopData in boxData.Loops)
			{
				bool flag = false;
				foreach (HouseBoxLoopData houseBoxLoopData2 in this.m_lstLoop)
				{
					if (houseBoxLoopData.Power.Equals(houseBoxLoopData2.Power))
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					result = false;
					break;
				}
			}
			return result;
		}

		public string ClassName
		{
			get
			{
				return this.m_strClassName;
			}
		}

		public Element Box
		{
			get
			{
				return this.m_eleBox;
			}
		}

		public List<HouseBoxLoopData> Loops
		{
			get
			{
				return this.m_lstLoop;
			}
		}

		private string m_strClassName;

		private List<HouseBoxLoopData> m_lstLoop = new List<HouseBoxLoopData>();

		private Element m_eleBox;
	}
}
